home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows5 / winnet.zip / NE2000.NOT < prev    next >
Text File  |  1990-02-28  |  2KB  |  83 lines

  1. This set of files is a Novell NE2000 ethernet packet driver interface,
  2. based on the old 3C503 driver. Here are some notes...
  3.  
  4. 1)    Driver type is set to 99, if a type number has been allocated
  5.     it should be changed.
  6.  
  7. 2)    I have implemented multicast filtering. In the process, I
  8.     found a few problems with head.asm, and a modified version
  9.     is enclosed.
  10.  
  11. 3)    The NE2000 responds with a 'W' during initialization, for
  12.     16 bit mode. If the board will work in 8 bit mode, I have
  13.     not written the code to implement it.
  14.  
  15. 4)    This was tested using Netware SFT and a patched version of
  16.     DECnet-DOS (which uses multicasts), with both running at
  17.     the same time.
  18.  
  19.  
  20.                             Dave Horne
  21.                             1/2/1990
  22.  
  23.  
  24. -------------------------------------------------------------------------------
  25.  
  26. NE2000B.asm
  27.  
  28. Here is the next version of the NE2000 driver. It's been modified to
  29. use the version 5 head.asm and tail.asm, and seems to work OK. There is
  30. also a modified head.asm included, which is the original head.asm with
  31. the a modification to the callback mechanism. The callback  in
  32. this version uses some real tacky code to allow either a far return from
  33. the user code or an interrupt return by:
  34.  
  35.     1)    sets carry off (flags must be an even number)
  36.     2)    pushes 1    ( and odd number !!)
  37.     3)    pushes flags incase an iret is uses
  38.     4)    does far call.
  39.     5)    on return, the flag should be at the top of the stack.
  40.         if the topp of the stack is 1, it cant be the flags
  41.         and so an iret has been uses.
  42.     6)    clean up stack.
  43.  
  44. Nasty eh ? The reason for this code is to allow programs written in
  45. Microsoft C to  install an interrupt type function as a receive handler.
  46. In this way, all the register saves and segment setup is taken care of.
  47.  
  48. Here's an example from a program I wrote:
  49.  
  50. /*      receiver routine. */
  51.  
  52.  
  53. interrupt far receiver(res,rds,rdi,rsi,rbp,rsp,rbx,rdx,rcx,rax)
  54. unsigned short res,rds,rdi,rsi;
  55. unsigned short rbp,rsp,rbx,rdx,rcx,rax;
  56. {
  57.     char far *buffer;
  58.     switch(rax)    /* ax is 0 for get buffer, 1 for read */
  59.     {
  60.     case 0:
  61.         buffer = GetaBuffer(rcx);
  62.         res = FP_SEG( buffer );
  63.         rdi = FP_OFF( buffer);
  64.         break;
  65.     case 1:
  66.         DoRead(rds, rsi);
  67.         break;
  68.     }
  69.  
  70. }
  71.  
  72. This routine can be called directly from the packet driver. Without the
  73. mod to head.asm, you have to
  74.     1)    Write an intermediat assembly language handler, or
  75.     2)    Write assembly language to exit the interrupt handler
  76.         before it returns. 
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.